home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / Networking / SANA-II / slip_src / param.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-17  |  5.2 KB  |  182 lines

  1. /*      @(#)param.h 2.39 89/10/09 SMI; from UCB 4.35 83/06/10   */
  2.  
  3. #ifndef __sys_param_h
  4. #define __sys_param_h
  5.  
  6. /*
  7.  * Machine type dependent parameters.
  8.  */
  9. /* #include <machine/param.h> */
  10.  
  11. #define NPTEPG          (NBPG/(sizeof (struct pte)))
  12.  
  13. /*
  14.  * Machine-independent constants
  15.  */
  16. #define NMOUNT  40              /* est. of # mountable fs for quota calc */
  17. #define MSWAPX  15              /* pseudo mount table index for swapdev */
  18. #define MAXUPRC 25              /* max processes per user */
  19. #define NOFILE  256             /* max open files per process */
  20. #define MAXPID  30000           /* max process id */
  21. #define MAXUID  0xfffd          /* max user id (from 60000)  */
  22. #define MAXLINK 32767           /* max links */
  23. #define CANBSIZ 256             /* max size of typewriter line */
  24. #define VDISABLE 0              /* use this to turn off c_cc[i] */
  25. #define PIPE_BUF 4096           /* pipe buffer size */
  26. #ifndef KERNEL
  27. /*
  28.  * HZ defines the ticks/second for system calls, eg, times(), which
  29.  * return values just in ticks; but not for getrusage(), which returns
  30.  * values in ticks*pages.  HZ *must* be 60 for compatibility reasons.
  31.  */
  32. #define HZ      60
  33. #endif
  34. #define NCARGS  0x100000        /* (absolute) max # characters in exec arglist */
  35. /* If NGROUPS changes, change <sys/limits.h> NGROUPS_MAX at the same time. */
  36. #define NGROUPS 16              /* max number groups */
  37.  
  38. #define NOGROUP -1              /* marker for empty group set member */
  39.  
  40. #ifdef  KERNEL
  41. /*
  42.  * Priorities
  43.  */
  44. #define PMASK   0177
  45. #define PCATCH  0400            /* return if sleep interrupted, don't longjmp */
  46. #define PSWP    0
  47. #define PINOD   10
  48. #define PAMAP   10
  49. #define PRIBIO  20
  50. #define PRIUBA  24
  51. #define PZERO   25
  52. #define PPIPE   26
  53. #define PVFS    27
  54. #define PWAIT   30
  55. #define PLOCK   35
  56. #define PSLEP   40
  57.  
  58. #ifdef  VPIX
  59. #define PV86    41
  60. #endif
  61.  
  62. #define PFLCK   42      /* File/Record lock */
  63.  
  64. #define PUSER   50
  65.  
  66. #define NZERO   20
  67. #endif  /* KERNEL */
  68.  
  69. /*
  70.  * Signals
  71.  */
  72. /* #include <sys/signal.h> */
  73.  
  74. #define ISSIG(p, flag) \
  75.         ((p)->p_sig && ((p)->p_flag&STRC || \
  76.          ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig(flag))
  77.  
  78. #define NBPW    sizeof (int)    /* number of bytes in an integer */
  79.  
  80. #ifndef NULL
  81. #define NULL    0
  82. #endif
  83. #define CMASK   0               /* default mask for file creation */
  84. #define NODEV   (dev_t)(-1)
  85.  
  86. #ifndef INTRLVE
  87. /* macros replacing interleaving functions */
  88. #define dkblock(bp)     ((bp)->b_blkno)
  89. #define dkunit(bp)      (minor((bp)->b_dev) >> 3)
  90. #endif
  91.  
  92. #define CBSIZE  28              /* number of chars in a clist block */
  93. #define CROUND  0x1F            /* clist rounding; sizeof (int *) + CBSIZE-1 */
  94.  
  95. #if     !defined(LOCORE) || !defined(KERNEL)
  96. #include <sys/types.h>
  97. #endif
  98.  
  99. /*
  100.  * File system parameters and macros.
  101.  *
  102.  * The file system is made out of blocks of at most MAXBSIZE units,
  103.  * with smaller units (fragments) only in the last direct block.
  104.  * MAXBSIZE primarily determines the size of buffers in the buffer
  105.  * pool. It may be made larger without any effect on existing
  106.  * file systems; however making it smaller make make some file
  107.  * systems unmountable.
  108.  *
  109.  * Note that the blocked devices are assumed to have DEV_BSIZE
  110.  * "sectors" and that fragments must be some multiple of this size.
  111.  */
  112. #define MAXBSIZE        8192
  113. #define DEV_BSIZE       512
  114. #define DEV_BSHIFT      9               /* log2(DEV_BSIZE) */
  115. #define MAXFRAG         8
  116.  
  117. #define btodb(bytes)                    /* calculates (bytes / DEV_BSIZE) */ \
  118.         ((unsigned)(bytes) >> DEV_BSHIFT)
  119. #define dbtob(db)                       /* calculates (db * DEV_BSIZE) */ \
  120.         ((unsigned)(db) << DEV_BSHIFT)
  121.  
  122. /*
  123.  * Map a ``block device block'' to a file system block.
  124.  * XXX - this is currently only being used for tape drives.
  125.  */
  126. #define BLKDEV_IOSIZE   2048
  127. #define bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
  128.  
  129. /*
  130.  * MAXPATHLEN defines the longest permissable path length,
  131.  * including the terminating null, after expanding symbolic links.
  132.  * MAXSYMLINKS defines the maximum number of symbolic links
  133.  * that may be expanded in a path name. It should be set high
  134.  * enough to allow all legitimate uses, but halt infinite loops
  135.  * reasonably quickly.
  136.  */
  137. #define MAXPATHLEN      1024
  138. #define MAXSYMLINKS     20
  139.  
  140. /*
  141.  * bit map related macros
  142.  */
  143. #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  144. #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  145. #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  146. #define isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  147.  
  148. /*
  149.  * Macros for fast min/max.
  150.  */
  151. #ifndef MIN
  152. #define MIN(a,b) (((a)<(b))?(a):(b))
  153. #endif
  154. #ifndef MAX
  155. #define MAX(a,b) (((a)>(b))?(a):(b))
  156. #endif
  157.  
  158. /*
  159.  * Macros for counting and rounding.
  160.  */
  161. #ifdef  sun386
  162. #define howmany(x, y)   ((((u_int)(x))+(((u_int)(y))-1))/((u_int)(y)))
  163. #define roundup(x, y)   ((((u_int)(x)+((u_int)(y)-1))/(u_int)(y))*(u_int)(y))
  164. #else
  165. #define howmany(x, y)   (((x)+((y)-1))/(y))
  166. #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
  167. #endif
  168.  
  169. /*
  170.  * Scale factor for scaled integers used to count
  171.  * %cpu time and load averages.
  172.  */
  173. #define FSHIFT  8               /* bits to right of fixed binary point */
  174. #define FSCALE  (1<<FSHIFT)
  175.  
  176. /*
  177.  * Maximum size of hostname recognized and stored in the kernel.
  178.  */
  179. #define MAXHOSTNAMELEN  64
  180.  
  181. #endif  /* !__sys_param_h */
  182.